<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../vue.js"></script>
</head>
<body>
<!-- vue层 -->
<div id="app">
    <name-title slot="name-title" :title="title"></name-title>
    <items slot="items" v-for="eachItem in items" :item="eachItem"></items>
</div>

<!-- 导入vue.js -->
<script>
    Vue.component("name-list",{
        template:'<div>\
                    <slot></slot> \
                    <ul>\
                        <slot></slot> \
                    </ul>\
                  </div>'
    })
    Vue.component("name-title",{
        props: ['title'],
        template:'<p>{{title}}</p>'
    })
    Vue.component("items",{
        props: ['item'],
        template:'<li>{{item}}</li>'
    })
    var app = new Vue({
        el: "#app",
        data: {
            title: 'names',
            items: [
                'rollingball',
                'bollu'
            ]
        }
    })
</script>
</body>
</html>